#!/usr/bin/env ./jsrun

var fib = function(n){ return n <= 1 ? 1 : fib(n-1) + fib(n-2) };

var make2 = function(f, n){
	for(var i=0; i<n; ++i)
		(function(i){setTimeout(function(){f(i)}, 0)})(i);
};



make(function(id){
	id = getThreadId();
	alert('thread ' + id);
	//for(var i=0; i<10; ++i)
	//	alert('thread ' + id + ': ' + fib(10));
}, 500);

alert("ALL DONE!!!");


sleep(100000);
